package com.javaee.controller;

import com.javaee.entity.Course;
import com.javaee.entity.TeachingClass;
import com.javaee.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Course")
public class CourseController {
    @Autowired
    private CourseService courseService;

    @PostMapping
    public Result create(@RequestBody Course course) {
        boolean flag = courseService.create(course);
        return new Result(flag ? Code.ADD_OK:Code.ADD_ERR,flag);
    }
}
